/**************************************************************************************** 
 Copyright © 2003-2012 ZTEsoft Corporation. All rights reserved. Reproduction or       <br>
 transmission in whole or in part, in any form or by any means, electronic, mechanical <br>
 or otherwise, is prohibited without the prior written consent of the copyright owner. <br>
 ****************************************************************************************/
package com.iwhalecloud.bss.kite.cucc.listener.offer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import com.iwhalecloud.bss.kite.cucc.listener.handler.LocalMemberMainOfferHandler;
import com.iwhalecloud.bss.kite.event.offer.InitMainOfferEvent;

/** 
 * <Description> <br> 
 *  
 * @author tengg<br>
 * @version 1.0<br>
 * @taskId <br>
 * @CreateDate 2021年11月24日 <br>
 * @since R9.0<br>
 * @see com.iwhalecloud.bss.kite.cucc.listener.offer <br>
 */
@Service
public class InitMemberMainOfferListener {
    @Autowired
    private LocalMemberMainOfferHandler localMemberMainOfferHandler;
    
    /**
     * 明细处理
     * @param event
     */
    @EventListener
    @Order(1)
    @Async
    public void registerMemberMainOffer(InitMainOfferEvent event) {
        String offerInstId = event.getParentInstId();
        String sceneInstId = event.getSceneInstId();
        String custId = event.getCustId();
        boolean offerType = event.isBoleType();
        if (offerType) {
            return;
        }
        localMemberMainOfferHandler.init(sceneInstId, offerInstId, custId);
    }
}
